package core.manager.sceneManager.SceneScript
{
    import core.manager.pluginManager.*;
    import core.manager.scriptManager.*;

    public class Scene0Script extends Object
    {
        public static function runSceneJustCompleteScript(maxZ:int) : void
        {
            switch(maxZ)
            {
                case -1:
                {
                    ScriptManager.getInstance().runScriptDirectly("setCameraRotationY(119.90);");
                    ScriptManager.getInstance().runScriptByName(ScriptName.ADD_ANIMATE, [2]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.START_RENDER, []);
                    break;
                }
                case 1:
                {
                    ScriptManager.getInstance().runScriptByName(ScriptName.SET_CAMERA_FOCUS, [375]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.ADD_ANIMATE, [2]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.START_RENDER, []);
                    break;
                }
                default:
                {
                	ScriptManager.getInstance().runScriptDirectly("setCameraRotationY(119.90);");
                    ScriptManager.getInstance().runScriptByName(ScriptName.ADD_ANIMATE, [2]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.LOAD_BACKGROUND_MUSIC, ["http://audio.pavilion.expo.cn/p5006/audio/backgroundmusic/bg1.mp3"]);
                    break;
                    break;
                }
            }
            return;
        }// end function

        public static function runSceneInitScript(maxZ:int) : void
        {
            switch(maxZ)
            {
                case -1:
                {
                    ScriptManager.getInstance().runScriptByName(ScriptName.SHOW_FLV, ["http://flv.pavilion.expo.cn/p5006/flv/scene_scene/_1_0.flv"]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.INIT_ON_FLV_PLAY_COMPLETE_SCRIPT, ["goto3DScene(0);setCameraRotationX(0.8);setCameraFocus(375);"]);
                    break;
                }
                case 1:
                {
                    ScriptManager.getInstance().runScriptByName(ScriptName.ADD_CONTROLER_COMPLETE_SCRIPT, ["showFlv(http://flv.pavilion.expo.cn/p5006/flv/scene_scene/1_0.flv);"]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.ADD_CONTROLER_COMPLETE_SCRIPT, ["stopRender();"]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.SET_CAMERA, [0.8, -65]);
                    ScriptManager.getInstance().runScriptByName(ScriptName.INIT_ON_FLV_PLAY_COMPLETE_SCRIPT, ["goto3DScene(0);"]);
                    break;
                }
                default:
                {
                    PluginManager.getInstance().showSinglePluginById("Pv3dModule");
                    ScriptManager.getInstance().runScriptUntilScriptExist("setCameraRotationY(119.90);");
                    ScriptManager.getInstance().runScriptUntilScriptExist("setCameraRotationX(0.8);");
                    ScriptManager.getInstance().runScriptUntilScriptExist("setCameraFocus(375);");
                    ScriptManager.getInstance().runScriptUntilScriptExist("goto3DScene(0);");
                    ScriptManager.getInstance().runScriptByName(ScriptName.DISPOSE_BACKGROUND_MUSIC, []);
                    break;
                }
            }
            return;
        }// end function

    }
}
